import com.max.eshop.services.Services;

public class Test {
	public static void main(String[] args) {

		Services servise = new Services();
		
		if (args.length != 0 && !args[0].equals(null)) {
			System.out.println(args[0]);
			System.out.println("zagruzka iz puti " + args[0]);
			servise.load(args[0]);
		} else {
			System.out.println("zagruzka iz papki");
			servise.load("");
		}
		System.out.println("Do Dobavleniya Knigi");
		servise.getBookService().sortedByAlphabet();
		servise.getOrderService().sortedByDate();
		servise.getBookService().show();
		servise.getBookService().add("kintastishk", "01.01.2000",
				"ThisKintastishIsBlokbaster", 4, 10000);
		servise.getBookService().add("kint", "01.01.2000",
				"ThisKintastishIsBlokbaster", 4, 10000);
		servise.getBookService().add("kintastish", "01.01.2000",
				"ThisKintastishIsBlokbaster", 2, 10000);
		System.out.println("Posle Dobavleniya Knigi");
		servise.getBookService().show();
		servise.getBookService().delete(5);
		System.out.println("Posle Ydaleniya Knigi");
		servise.getBookService().show();
		System.out.println("Do Dobavleniya Zakaza");
		servise.getOrderService().show();
		servise.getOrderService().add("kintastishk", 2);
		servise.getOrderService().add("kintastishk", 5);
		servise.getOrderService().add("ki", 5);
		System.out.println("Posle Dobavleniya Zakaza");
		servise.getOrderService().show();
		servise.getOrderService().delete(3);
		System.out.println("Posle Ydaleniya Zakaza");
		servise.getOrderService().show();
		System.out.println("Posle vipolnenie zakaza");
		servise.getOrderService().execute(3);
		servise.getOrderService().show();
			System.out.println("Posle vipolnenie zakaza Knigi");
		servise.getBookService().show();
		System.out.println("Posle dobavleniya zayavki");
		servise.getReqestService().add("skazki", 6);
		servise.getReqestService().show();
		System.out.print("Colichestvo vipolnenih zakazov: ");
		servise.getOrderService().showExecute("01.01.2000", "11.11.2014",
				"count");
		servise.getOrderService().showExecute("01.01.2000", "11.11.2014",
				"list");
		System.out.print("Summa poluchenih deneg za vipolnenie zakazi: ");
		servise.getOrderService()
				.showExecute("01.01.2000", "11.11.2014", "sum");
		System.out.println("Spisok zalewavshihsa Knig");
		servise.getBookService().showStale();
		
	}
}
